package com.jeasonzhao.report.engine.servlet;

import com.jeasonzhao.report.engine.Configuration;
import com.jeasonzhao.report.engine.repo.ReportRepository;
import com.jeasonzhao.report.model.Report;
import com.jeasonzhao.web.BodyCarelessTag;

public class TagReportList extends BodyCarelessTag
{
    private static final long serialVersionUID = 1L;
    public TagReportList()
    {
        super();
        Configuration.getInstance().refreshConfigurations();
    }

    protected void body()
    {
        for(Report rpt : ReportRepository.getInstance().getAllReports())
        {
            this.write("<li><a href=\"" + rpt.getReportId() + ".rpt\">" + rpt.getTitle() + "</a></li>");
        }
    }

}
